<?php
class PurposeServer  {
	public function infiniteClass($data){
		$list=HttpDaoManager::getPurposeDao()->getListByFatherId($data['id']);
		$i=0;
		$info = array();
		foreach ($list as $rs)		{
			$i++;
			if ($rs['father_id'] !="")			{
				$rs['next'] = $this->infiniteClass($rs);
			}
			$info[]=$rs;
			if ($i==count($list))	{
				return  $info;
			}
		}
	}
	public function deleteBatchByid($id){
		if (is_array($id)){
			$id = implode(',',$id);
		}
		HttpDaoManager::getPurposeDao()->deleteBatchByid($id);
	}
}
?>